package b2.scene.fight.skills
{
	import b2.scene.fight.PlayState;
	import b2.scene.fight.TankSprite;
	
	import com.greensock.TweenLite;
	
	public class Invisible extends BasicSkill
	{
		public var isInVisible:Boolean;
		
		public function Invisible(tankId:int, tankSide:int ,level:int, skillArgs:Object)
		{
			isInVisible = false;
			super(tankId, tankSide ,level, skillArgs);
			coolDown = 4;
		}
		
		public override function discharge(x:int, y:int, direction:int):void
		{
			var tank:TankSprite = getOwner();
			if (isInVisible)
			{
				getPlayState().tankTweenLiteTo(tankId, 500, tank.direction, tank.x, tank.y, tank.x, tank.y, 1, true);
			}
			else
			{
				getPlayState().tankTweenLiteTo(tankId, 500, tank.direction, tank.x, tank.y, tank.x, tank.y, 0, true);
			}
			isInVisible = !isInVisible;
			super.discharge(x, y, direction);
		}
	}
}